<template>
    <h2>{{person}}</h2>
    <button @click="updatePerson">点击修改</button>
</template>
<script>
import { defineComponent } from 'vue'
export default defineComponent({
    name: 'Setup',
    components: { },
    setup () {
        let person = {
            name: '你好',
            age: 18
        }
        let p = new Proxy(person, {
            get () {
                console.log(p)
            },
            set (val) {
                console.log(val)
            }
        })
        function updatePerson() {
            p.name = 'jajajja'
            console.log(p)
            console.log(person)
        }
        return {
            person,
            updatePerson
        }
    }
})
</script>
<style lang="">
    
</style>